from django.db import models
class User(models.Model):
    user_name = models.CharField(verbose_name="用户名",max_length=32,unique=True)
    real_name = models.CharField(verbose_name="真实姓名",max_length=32,null=True,blank=True)
    password1 = models.CharField(verbose_name="密码1",max_length=32)
    password2 = models.CharField(verbose_name="密码2",max_length=32)
    phone = models.CharField(verbose_name="手机号",max_length=11,null=True,blank=True)
    head_img = models.ImageField(upload_to="avatar",verbose_name="头像",null=True,blank=True)
    address = models.CharField(verbose_name="地址",max_length=256,null = True,blank = True)
    is_cancel = models.BooleanField(verbose_name="是否注销",default=False)
    created_time = models.DateTimeField(verbose_name="创建时间",auto_now_add=True)
    updated_time = models.DateTimeField(verbose_name="更新时间",auto_now=True)
    class Meta:
        db_table = "moh_user"
        verbose_name = "用户表"
        verbose_name_plural = "用户表"

    def __str__(self):
        return f"{self.user_name},{self.password2},{self.phone},{self.address}"

